Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
brain.js not showing a result + showing "output" as wrong

I have to say "I just started working with neural nets and I have almost zero clue what I'm doing."

My Code: index.html

<!DOCTYPE html>
<html lang ="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=safari">
    <title>Document</title> 
    <script src="//unpkg.com/brain.js" defer></script>
    <script src="brain.js" defer></script>
</head>
<body>
    <div id="diagram"></div>
</body>
</html>

brain.js

const config = {
    binaryThresh: 0.5,
    hiddenLayers: [3], 
    activation: 'sigmoid' 
};
  
const net = new brain.NeuralNetwork(config);

net.train([
    {
        input: [0, 0]
        output: [0]
    },
    {
        input: [1, 0]
        output: [1]
    },
    {
        input: [0, 1]
        output: [1]
    },
    {
        input: [1, 1]
        output: [0]
    }
])

const diagram = document.getElementById("diagram")
diagram.innerHTML = brain.utilities.toSVG()

im tring to use brain.js details: On a Mac, on visual studio, can't find a answer online

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I forgot to put a comma after the inputs

so sorry

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!